using Contacts.Maui.ViewModels;
using System.Collections.ObjectModel;
using CoreBusinessContact = Contacts.CoreBusiness.Contact;

namespace Contacts.Maui.Views_MVVM;

public partial class AddContactPage_MVVM : ContentPage
{
    private readonly ContactViewModel contactViewModel;

    public AddContactPage_MVVM(ContactViewModel contactViewModel)
    {
        InitializeComponent();
        this.contactViewModel = contactViewModel;
        this.BindingContext = contactViewModel;
    }

    protected override void OnAppearing()
    {
        base.OnAppearing();
        contactViewModel.Contact = new CoreBusinessContact();
    }
}